1. Field of the Invention
The present invention relates to a technique of compressing image data and its attribute data for each predetermined block, and a technique of performing image processing and restoration processing of an image compressed for each block.
2. Description of the Related Art
With an increase in resolution of an image, the number of pixels which require image processing is dramatically increasing, so the processing load is getting heavier. To combat this problem, compression processing is applied to image data to be processed. For example, as color still image compression schemes, a JPEG scheme which uses discrete cosine transformation and a scheme which uses wavelet transformation are widely employed. Encoding schemes of these kinds generally encode an image for each predetermined block (for example, for each unit of 8×8 or 16×16 pixels), and perform discrete cosine transformation, quantization, and entropy coding, thereby attaining high compression efficiency. Because encoding schemes of these kinds use variable-length coding, the code length changes for each image data to be encoded.
When the above-mentioned image compression is used, processing of decoding compressed data becomes necessary to convert each pixel data. In other words, image processing cannot be performed for compressed data intact, so its decoding processing inevitably becomes necessary. This makes it necessary to process all pixels in high-resolution data for each pixel, thus prolonging the processing time.
Also, as compression processing techniques, the known run length encoding scheme of storing pixel data and their run lengths, and a technique of compressing data by reducing the number of colors to two or fewer colors for each block and outputting color data corresponding to two colors and the layout shape of these two colors, as described in Japanese Patent Laid-Open No. 2008-271046, have been disclosed.
In Japanese Patent Laid-Open No. 2008-271046, every block has two colors, and shape information associated with the layout of these two colors and color information of these two colors are stored. However, to achieve a higher image quality and a higher processing speed, the applicant of the present invention proposes a technique of compression without degrading the image quality of a block having data types larger in number than those of two colors in Japanese Patent Application No. 2009-221444. In Japanese Patent Application No. 2009-221444, first, image data is divided into blocks (for example, blocks each including 2×2 pixels), and color data of respective pixels in the same block are compared with each other. Thus, layout pattern information of color data included in the block of interest, and color data information corresponding to the number of colors included in the block of interest, are output. Among the output color data information, first color data information (for example, color data information of the upper left pixel in each block with a size of 2×2 pixels) corresponding to a pixel at a predetermined position in this block and other color data information (second to fourth color data information) are separately stored in different memory areas. That is, the feature of this patent reference lies in that a set of layout pattern information obtained from each block, a set of first color data information, and a set of other color information are stored in different memory areas.
Because each block is more likely to have pixels with the same color, the data stored in the memory area is compressed data with a size smaller than data of the original image. Also, because the first color data information is the pixel value of a pixel at a predetermined position in each block, the first color data information stored in a continuous memory area is equivalent to a low-resolution image generated by simply thinning the original image. Therefore, low-resolution image data can be easily obtained as well. Also, locating low-resolution image data including the first color data information of each block in a continuous memory area facilitates processing of encoded data intact, thus allowing even pixel processing for a low-resolution image without decoding.